package change

func Row_Change(p *[][]byte) [][]byte {
	re := make([][]byte, 4)
	for j := 0; j < 4; j++ {
		re[j] = make([]byte, 4)
	}
	for i := 0; i < len(re); i ++ {
		for j := 0; j < 4; j++ {
			re[i][j] = (*p)[i][(j + i) % 4]
		}
	}
	return re
}

// 逆行移位
func Re_Rowchange(p *[][]byte) [][]byte {
	re := make([][]byte, 4)
	for j := 0; j < 4; j++ {
		re[j] = make([]byte, 4)
	}
	for i := 0; i < len(re); i ++ {
		for j := 0; j < 4; j++ {
			re[i][j] = (*p)[i][(j + 4 - i) % 4]
		}
	}
	return re
}

